package com.yy.student.service.impl;

import com.yy.student.dao.StudentDao;
import com.yy.student.entity.StudentEntity;
import com.yy.student.service.StudentSer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class StudentSerImpl implements StudentSer {
    @Autowired
    private StudentDao dao;
    @Override
    public List<StudentEntity> findAll() {
        return dao.findAll();
    }

    @Override
    public StudentEntity findById(Long id) {
        return dao.findById(id).get();
    }

    @Override
    public StudentEntity save(StudentEntity student) {
        return dao.save(student);
    }

    @Override
    public void delete(StudentEntity student) {
        dao.delete(student);
    }
}
